package com.big.model.model.merchandise;

import com.big.model.model.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@ApiModel(value = "商品")
@Data
@TableName("merchandise_info")
@Document(indexName = "merchandise_es", type = "_doc" , shards = 1, replicas = 0)
public class MerchandiseInfo extends BaseEntity {

    @ApiModelProperty(value = "id")
    @TableField("id")
    @Id
    private Long id;

    @ApiModelProperty(value = "雪花编号")
    @TableField("snowflake_id")
    private Long snowflakeId;

    @ApiModelProperty(value = "商品名称")
    @TableField("name")
    @Field(type = FieldType.Text,analyzer = "pinyin_analyzer",searchAnalyzer = "pinyin_analyzer")
    private String name;

    @ApiModelProperty(value = "原价")
    @TableField("original_price")
    private double originalPrice;

    @ApiModelProperty(value = "现价")
    @TableField("selling_price")
    private double sellingPrice;

    @ApiModelProperty(value = "状态")
    @TableField("m_status")
    private Integer mStatus;


}
